#include "LoginSystemModule.h"
#include "../LoginService.h"
#include "../AccountMgr.h"
#include "base/core/com_define.h"
#include "base/core/os/time.h"
#include "base/core/Profiler.h"
#include "base/core/gamemath.h"
#include "base/net/net_pack_handle.h"
#include "ProtoBuffer/AllProtocol.h"
#include "Common/Utility/ServerTime.h"
#include "Common/AccountDefine.h"

#ifdef _MSC_VER
#pragma warning(disable:4100)
#pragma warning(disable:4244)
#pragma warning(disable:4102)
#endif

using namespace ProtoBuf;


LoginSystemModule::LoginSystemModule()
{

}

LoginSystemModule::~LoginSystemModule()
{

}


bool LoginSystemModule::Init()
{
	IMessageDispatch *pMessageDispatch = g_GetLoginService()->GetServiceMessageDispatch();
	if (nullptr == pMessageDispatch)
	{
		return false;
	}
	//处理重定向，广播等
	pMessageDispatch->registerServerHandler(EMODULE_ID_SERV_SYS, this);

	return true;
}

void LoginSystemModule::UnInit()
{
	IMessageDispatch *pMessageDispatch = g_GetLoginService()->GetServiceMessageDispatch();
	if (nullptr == pMessageDispatch)
	{
		return;
	}
	pMessageDispatch->unregisterServerHandler(EMODULE_ID_SERV_SYS);
}


void LoginSystemModule::onServerMessage(uint32_t actionId, RECV_PACKAGE &package)
{
	switch (actionId)
	{
	case LOGIN_SERVER_PROTOCOL_PING_REQ:
		{
		}
		break;
	default:
		break;
	}
}